<template>
  <div>
    <el-upload ref="rebateUpload"
               class="upload-demo"
               drag
               :action="upload"
               name="excel"
               :limit="1"
               :before-upload="beforeUpload"
               :headers="headerUpload"
               :on-success="handleSuccess"
               :on-remove="handleRemove"
               :show-file-list="false"
               :on-error="handleError"
               v-show="isShowUpload">
      <i class="el-icon-upload"></i>
      <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
    </el-upload>
    <div class="upload-name-box">
      <div class="upload-name"
           v-show="isShowUploadtxt">
        {{uploadFile.name}}
        <span @click="handleRemove">x</span>
      </div>
      <el-progress :percentage="percentage"
                   :color="customColor"
                   v-show="isShowPer"></el-progress>
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  data() {
    return {}
  },
  computed: {
    upload: () => {
      return `${process.env.BASE_URL}receive/virus/upload/step1`
    },
    headerUpload: () => {
      const data = {}
      data.TOKEN = getToken()
      if (localStorage.getItem('spr-lang') === 'en') {
        data.LANG = 'ENG' // 传语言
      }
      return data
    },
  },
}
</script>

<style lang="scss" scoped>
</style>